Skip to content

Sync python-send-email with the updated tutorial - #873

Merged
realpython-bot merged 2 commits into
masterfrom
maintenance/python-send-email-20261003
Oct 21, 2026
Merged

realpython-bot merged 2 commits into
masterfrom
maintenance/python-send-email-20261003

Conversation

@realpython-bot

Copy link
Copy Markdown
Collaborator

Syncs python-send-email/ with the maintenance update of Sending Emails With Python.

What changed

  • Added sendgrid_example.py, the SendGrid example from the article, with the fixed error handler (print(str(e)) instead of print(e.message), which raised AttributeError on Python 3).
  • Pinned the article's dependencies in pyproject.toml to match the article's dependencies field: aiosmtpd==1.4.6, yagmail[all]==0.16.0, proton-mail-bridge-client==1.0.1, sendgrid==6.12.5. Regenerated requirements.txt (uv pip compile) and uv.lock.

Links

Verification

  • Fresh Python 3.12 venv from requirements.txt.
  • Ran every stdlib script (plain text, HTML, attachment, reply-to, multiple recipients, address, CSV) against a local aiosmtpd server on port 8025. All exited cleanly.
  • sendgrid_example.py without an API key prints HTTP Error 401: Unauthorized instead of crashing.
  • Imported yagmail (0.16.0), proton_mail_bridge_client, and sendgrid, and compiled the Yagmail and Proton examples. Sending through them needs real credentials, so they weren't run end to end.
  • ruff@0.14.1 format --check and ruff@0.14.1 check both pass.

🤖 Generated with Claude Code

@realpython-bot
realpython-bot merged commit c6669a6 into master Oct 21, 2026
1 check passed
@realpython-bot
realpython-bot deleted the maintenance/python-send-email-20261003 branch October 21, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant